// Joystick up
#define ON_JOYSTICK_UP                  if(!(PINB & (1 << 6)))
/// Execute the following instruction if the joystick up button is pressed.
#define OFF_JOYSTICK_UP                 if(PINB & (1 << 6))
/// Execute the following instruction if the joystick up button is not pressed.
#define WAIT_FOR_JOYSTICK_UP            while(PINB & (1 << 6));
/// Wait until the joystick up button is pressed.
#define WAIT_FOR_RELEASE_JOYSTICK_UP    while(!(PINB & (1 << 6)));
/// Wait until the joystick up button is released.

// Joystick down

#define ON_JOYSTICK_DOWN                 if(!(PINB & (1 << 7)))
/// Execute the following instruction if the joystick down button is pressed.
#define OFF_JOYSTICK_DOWN                if(PINAB& (1 << 7))
/// Execute the following instruction if the joystick down button is not pressed.
#define WAIT_FOR_JOYSTICK_DOWN            while(PINB & (1 << 7));
/// Wait until the joystick down button is pressed.
#define WAIT_FOR_RELEASE_JOYSTICK_DOWN    while(!(PINB& (1 << 7)));
/// Wait until the joystick down button is released.

// Joystick right

#define ON_JOYSTICK_RIGHT                if(!(PINE & (1 << 3)))
/// Execute the following instruction if the joystick right button is pressed.
#define OFF_JOYSTICK_RIGHT               if(PINE & (1 << 3))
/// Execute the following instruction if the joystick right button is not pressed.
#define WAIT_FOR_JOYSTICK_RIGHT          while(PINE & (1 << 3));
/// Wait until the joystick right button is pressed.
#define WAIT_FOR_RELEASE_JOYSTICK_RIGHT   while(!(PINE & (1 << 3)));
/// Wait until the joystick right button is released.

// Joystick left

#define ON_JOYSTICK_LEFT                 if(!(PINE & (1 << 2)))
/// Execute the following instruction if the joystick left button is pressed.
#define OFF_JOYSTICK_LEFT                if(PINE & (1 << 2))
/// Execute the following instruction if the joystick left button is not pressed.
#define WAIT_FOR_JOYSTICK_LEFT           while(PINE & (1 << 2));
/// Wait until the joystick left button is pressed.
#define WAIT_FOR_RELEASE_JOYSTICK_LEFT   while(!(PINE & (1 << 2)));
/// Wait until the joystick left button is released.

// Joystick center

#define ON_JOYSTICK_LEFT                 if(!(PINB & (1 << 4)))
/// Execute the following instruction if the joystick center button is pressed.
#define OFF_JOYSTICK_LEFT                if(PINB & (1 << 4))
/// Execute the following instruction if the joystick center button is not pressed.
#define WAIT_FOR_JOYSTICK_LEFT           while(PINB & (1 << 4));
/// Wait until the joystick center button is pressed.
#define WAIT_FOR_RELEASE_JOYSTICK_LEFT   while(!(PINB & (1 << 4)));
/// Wait until the joystick center button is released.
